<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->id();
            $table->string('username')->comment('名称');
            $table->string('avatar')->nullable()->comment('头像');
            $table->string('password')->comment('登录密码');
            $table->string('role', 64)->default('admin')->comment('角色:admin,temp');
            $table->tinyInteger('status')->default(1)->comment('启用状态(1:已启用, 2:已禁用)');
            $table->integer('sort')->default(0)->comment('排序值');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
}
